using Microsoft.Xna.Framework;
using System;

namespace ZombieHigh2.World
{
    public class WorldItem
    {
        int itemType;
        BoundingSphere bsphere;
        Vector3 location;

        public int ItemType
        {
            get { return itemType; }
        }

        public Vector3 Position
        {
            get { return location; }
        }

        public BoundingSphere BoundingSphere
        {
            set { bsphere = value; }
            get { return bsphere; }
        }

        public WorldItem(int type, Vector3 location)
        {
            this.itemType = type;
            this.location = location;
            this.bsphere = new BoundingSphere();
        }

        public WorldItem(int type, Vector3 location, BoundingSphere bsphere)
        {
            this.itemType = type;
            this.bsphere = bsphere;
            this.location = location;
        }

        public static int ConvertStringToWorldItemType(String name)
        {
            if (name.Equals("health"))
                return WorldConstants.ITEM_HEALTH;
            else if (name.Equals("strength"))
                return WorldConstants.ITEM_STRENGTH;
            else if (name.Equals("key"))
                return WorldConstants.ITEM_KEY;
            else if (name.Equals("weapon_straw"))
                return WorldConstants.WEAPON_STRAW;
            else if (name.Equals("weapon_can"))
                return WorldConstants.WEAPON_CAN;
            else if (name.Equals("weapon_knife"))
                return WorldConstants.WEAPON_KNIFE;
            else if (name.Equals("ammo_paper"))
                return WorldConstants.AMMO_PAPER;

            return WorldConstants.ITEM_UNKNOWN;
        }
    }
}
